---
- hosts: "nodes"
  remote_user: root
  gather_facts: yes
  connection: ssh

  vars_prompt:

   - name: "zerotier_network_id"
     prompt: "Enter zerotier network id"
     private: no 
     
  tasks:
  
    - name: install zerotier
      shell: |
        set -o pipefail
        curl -s https://install.zerotier.com  | bash
      args:
        executable: /bin/bash

    - name: Join ZeroTier network
      command: zerotier-cli join {{ zerotier_network_id }}
